package com.cjkj.system.api;

import com.cjkj.common.core.constant.SecurityConstants;
import com.cjkj.common.core.constant.ServiceNameConstants;
import com.cjkj.common.core.domain.R;
import com.cjkj.system.api.domain.APIEquipmentUsageRecords;
import com.cjkj.system.api.domain.APIHospitalEquipment;
import com.cjkj.system.api.domain.dto.APIEquipmentStatusDto;
import com.cjkj.system.api.factory.RemoteHospitalEquipmentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author 93000
 */
@FeignClient(contextId = "remoteEquipmentSystemService",value = ServiceNameConstants.SYSTEM_SERVICE,fallbackFactory = RemoteHospitalEquipmentFallbackFactory.class )
public interface RemoteHospitalEquipmentService {

    @GetMapping("/equipmentUsageRecord/get/{equipmentNo}")
    R<APIEquipmentUsageRecords> getRecordsByEquipment(@PathVariable("equipmentNo") String equipmentNo,
                                                      @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/equipment/get/{equipmentId}")
    R<APIHospitalEquipment> getHospitalEquipmentInfo(@PathVariable("equipmentId") String equipmentId,
                                                     @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/equipment/update/status")
    R<Integer> updateEquipmentStatus(@RequestBody APIEquipmentStatusDto dto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/equipmentUsageRecord/updateUseRecordStatus")
    R<Integer> updateEquipmentUsageRecordStatus(@RequestBody APIEquipmentUsageRecords dto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
